package com.tjh.springbootapi.controller;

import com.koala.apiprototype.annotations.IgnoreValidate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/user")
public class LoginController {

    @PostMapping("/login1")
    @IgnoreValidate
    public void login1(@RequestBody Map<String, String> person) {
        System.out.println("name = " + person.get("name"));
    }

    @PostMapping("/login4")
    @IgnoreValidate
    public void login4() {
        System.out.println("测试");
    }

    @GetMapping("/login2")
    @IgnoreValidate
    public void login2(@RequestParam(name = "name") String name) {
        System.out.println("name = " + name);
    }

    @GetMapping("/login3/{name}")
    @IgnoreValidate
    public void login3(@PathVariable(name = "name") String name) {
        System.out.println("name = " + name);
    }

}
